Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ICustomQueryInterface to support aggregation and hidden interfaces #128

Merged
merged 16 commits into from
Apr 16, 2020

Conversation

jkoritzinsky
Copy link
Member

@jkoritzinsky jkoritzinsky commented Apr 10, 2020

Implement ICustomQueryInterface and limited interface inheritance to support WinUI's assumptions around COM Aggregation and interface exclusivity.

Fixes #126

…support WinUI's assumptions around COM Aggregation and interface exclusivity.
@jkoritzinsky jkoritzinsky changed the title [NO MERGE] Implement ICustomQueryInterface to support aggregation and hidden interfaces Implement ICustomQueryInterface to support aggregation and hidden interfaces Apr 14, 2020
@jkoritzinsky
Copy link
Member Author

We have an updated version of .NET now, so I've tested this against it and it seems to work.

@stevenbrix can you run this against your test to make sure it's working as you expect?

@stevenbrix
Copy link
Contributor

@jkoritzinksy, there is the WinUIDesktopSample app - did you test with that?

@jkoritzinsky
Copy link
Member Author

Yep. I got a window entry to show up in the task bar but no visible window. I also was testing with the unpackaged app since the package wouldn't deploy. I don't know what behavior we were expecting once this was fixed, so I don't know if I got the expected behavior.

@jkoritzinsky
Copy link
Member Author

Ok I investigated more and realized we weren't handling the overrides interfaces correctly (we were returning the native implementation instead of the managed implementation). Once that's handled, I'm still hitting an InvalidCastException in set_Content.

@stevenbrix
Copy link
Contributor

Yeah, the InvalidCastException is a new issue that's creeped in.

@stevenbrix
Copy link
Contributor

I think that needs to be fixed as part of this PR as well

@jkoritzinsky
Copy link
Member Author

Ok I've finally fixed all of the issues I could find with composition and overriding.

We can now create a window on screen with a button, and when that button is clicked change the content to be a XAML-based user defined page.

@jkoritzinsky
Copy link
Member Author

I found an RCW caching issue in this PR and fixed it as well as #143 since that was part of the cause.

@Scottj1s Scottj1s merged commit 9a8aa19 into master Apr 16, 2020
@Scottj1s Scottj1s deleted the jkoritzinsky/custom-qi branch April 16, 2020 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSWinRT support for ICustomQueryInterface
3 participants